import type { RouteRecordRaw } from 'vue-router';

// 经销商路由配置
const distributorRoutes: Array<RouteRecordRaw> = [
  {
    path: '/distributor',
    name: 'Distributor',
    redirect: '/distributor/dashboard',
    meta: {
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/dashboard',
    name: 'DistributorDashboard',
    component: () => import('@/views/distributor/DashboardPage.vue'),
    meta: {
      title: '经销商控制台',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/products',
    name: 'DistributorProducts',
    component: () => import('@/views/distributor/ProductsPage.vue'),
    meta: {
      title: '产品管理',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/payment-links',
    name: 'DistributorPaymentLinks',
    component: () => import('@/views/distributor/PaymentLinksPage.vue'),
    meta: {
      title: '代付链接',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/fans',
    name: 'DistributorFans',
    component: () => import('@/views/distributor/FansPage.vue'),
    meta: {
      title: '打粉管理',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/orders',
    name: 'DistributorOrders',
    component: () => import('@/views/distributor/OrdersPage.vue'),
    meta: {
      title: '订单管理',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/commissions',
    name: 'DistributorCommissions',
    component: () => import('@/views/distributor/CommissionsPage.vue'),
    meta: {
      title: '佣金管理',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/withdrawalPage',
    name: 'WithdrawalPage',
    component: () => import('@/views/distributor/WithdrawalPage.vue'),
    meta: {
      title: '佣金管理',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
  {
    path: '/distributor/account',
    name: 'DistributorAccount',
    component: () => import('@/views/distributor/AccountPage.vue'),
    meta: {
      title: '账户设置',
      requiresAuth: true,
      requiresDistributor: true,
    },
  },
];

export default distributorRoutes;
